<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.fit.user.dao.*"  %>
<%@ page import="com.fit.user.entity.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String contextPath = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+contextPath+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'manager.jsp' starting page</title>
      
   <style type="text/css">

body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}


</style>
<script type="text/javascript">
function gofun(_link) {
    window.top.frames('mainFrame').location.href=_link;

 }

</script>
<link href="<%=contextPath%>/img/skin/skin.css" rel="stylesheet" type="text/css" />
		<link href="<%=contextPath%>/css/sic.css" rel="stylesheet" type="text/css" />
 
    
    
<%
String flag = (String)request.getAttribute("flag");
if(flag!=null&&flag.equals("true")){

%>

  <script type="text/javascript"> 
function gofun_beian()
  {
  alert("录入部门信息成功！");
  }
  
</script>
<%
}else if(flag!=null&&flag.equals("false")){
%>
<h2></h2>
  <script type="text/javascript">
function gofun_beian()
  {
  alert("录入部门信息失败！");
  }
  
</script>
<%
}
 %>
<!--  //查询得到所有部门信息 -->
<%
SectionMsgDAO sectionMsgDAO = new SectionMsgDAO();
List<SectionMsgEntity> list = sectionMsgDAO.getSectionMsg();
String[] str = {"部门编号","部门名称","操作"};
 %>
  </head>
  
  <body>
 
  
  
  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="<%=contextPath%>/img/skin/mail_leftbg.gif"><img src="<%=contextPath%>/img/skin/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="<%=contextPath%>/img/skin/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">部门管理</div></td>

      </tr>
    </table></td>
    <td width="16" valign="top" background="<%=contextPath%>/img/skin/mail_rightbg.gif"><img src="<%=contextPath%>/img/skin/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="<%=contextPath%>/img/skin/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"  class="table_boder">
     <table width="100%" height="350" border="0" cellpadding="0" cellspacing="0">
		<tr><td align="center"><h2>增加部门</h2></td></tr>
	<tr><td valign="top" align="center">
 <form action="<%=basePath %>/sectionMsg.do?oper=submit_section" method="post">
  <table class="table_boder" cellpadding="0" cellspacing="0">
    <tr>
<td align="right">部门编号：</td><td><input type="text" name="sectionMsgEntity.sectionID"/></td>
  </tr>
    <tr>
<td align="right">部门名称：</td><td><input type="text" name="sectionMsgEntity.sectionName"/></td>
  </tr>
   <tr>
      <td colspan="4" align="center"><input type="submit" value="提交"> 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<input type="button" name="cancel" value="重置"></td>
      
      </tr>
  </table>
  </form>
  <%
String del_flag = (String)request.getParameter("del_flag");
if(del_flag!=null&&del_flag.equals("true")){

%>

  <script type="text/javascript">
				alert("删除成功！");
			</script>
<%
}else if(del_flag!=null&&del_flag.equals("false")){
%>

  <script type="text/javascript">
				alert("删除失败！");
			</script>
<%
}
 %>
  <table  class="table_boder" cellSpacing="0" cellPadding="0" width="60%" id="changecolor" >
  <tr  align="center" class="myrow" bgcolor="#1D639F">
  <c:forEach var="name" items="<%=str %>">
  <td  class="td_boder"  style="color:#ffffff;">${name }</td>
  </c:forEach>
  </tr>
  <%
  if(list!=null){
   %>
  <c:forEach var="sectionMsgEntity" items="<%=list %>">
  <tr >
  <td>${sectionMsgEntity.sectionID }</td><td>${sectionMsgEntity.sectionName }</td>
  <td><a href="servlet/DeleteSctionMsg?sectionID=${sectionMsgEntity.sectionID }">删除此部门信息</a></td>
  </tr>
  </c:forEach>
  <%
  }
   %>
  </table>
						</td></tr></table>
	</td>
    <td background="<%=contextPath%>/img/skin/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="<%=contextPath%>/img/skin/mail_leftbg.gif"><img src="<%=contextPath%>/img/skin/buttom_left2.gif" width="17" height="17" /></td>
    <td background="<%=contextPath%>/img/skin/buttom_bgs.gif"><img src="<%=contextPath%>/img/skin/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="<%=contextPath%>/img/skin/mail_rightbg.gif"><img src="<%=contextPath%>/img/skin/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
  </body>
</html>
